<div id="main-content">
    <div class="container">
    	<div class="row">
    		<div id="content" class="col-lg-12">
    			<!-- PAGE HEADER-->
    			<div class="row">
    				<div class="col-sm-12">
                        <div class="page-header">
    						<div class="clearfix">
    							<h3 class="content-title pull-left">Chỉnh sửa bài viết</h3>
    						</div>
    						<div class="description">Xin mời nhập theo mẫu bên dưới</div>
   					    </div>
   				     </div>
    			</div>
                <!-- DATA TABLES -->
						<div class="row">
							<div class="col-md-12">
								<!-- BOX -->
								<div class="box border green">
									<div class="box-title">
										<h4><i class="fa fa-table"></i>Chỉnh sửa câu hỏi</h4>
										<div class="tools hidden-xs">
											<a href="javascript:;" data-toggle="tooltip" title="Ẩn đi" class="collapse">
												<i class="fa fa-chevron-up"></i>
											</a>
										</div>
									</div>
									<div class="box-body">
                                        <!-- Start Form -->
                                         <?php echo validation_errors(); ?>
                                        <form method="POST" class="form-horizontal row-border" action="<?php echo base_url().'admin/xuly/question_test/list/'.$this->uri->segment(5);?>">
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Trạng thái:</label> 
											 <div class="col-md-10">
                                                <select name="publish" id="input" class="form-control">
                                                <option <?php if(!empty($data)){if($data->publish=='1')echo 'selected="selected"';} ?> value='1'>Hiện</option> 
                                                <option <?php if(!empty($data)){if($data->publish=='0')echo 'selected="selected"';} ?> value='0'>Ẩn</option> 
                                                </select>
                                             </div>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Môn học:</label> 
											 <div class="col-md-10">
                                                <select name="id_subjects" id="input" class="form-control">
                                                        <?php $parent_sub = $this->common_model->getdata('subjects',array('publish'=>1,'parentid'=>0),array('id','title'),array('order','ASC'));
                                                              if(!empty($parent_sub))
                                                                {
                                                                    foreach ($parent_sub as $sub)
                                                                        { ?>
                                                                            <option <?php if(!empty($data)){if($data->id_subjects == $sub->id)echo 'selected="selected"';} ?> value='<?php echo $sub->id; ?>'><?php echo $sub->title; ?></option> 
                                                                        <?php
                                                                            $child_sub = $this->common_model->getdata('subjects',array('publish'=>1,'parentid'=>$sub->id),array('id','title'),array('order','ASC'));
                                                                            if(!empty($child_sub))
                                                                                {
                                                                                    foreach($child_sub as $sub2)
                                                                                        { ?>
                                                                                            <option <?php if(!empty($data)){if($data->id_subjects == $sub2->id)echo 'selected="selected"';} ?> value='<?php echo $sub2->id; ?>'><?php echo '---'.$sub2->title; ?></option> 
                                                                                        <?php }
                                                                                }
                                                                         }
{}
                                                                }
                                                         ?>
                                                </select>
                                             </div>
										  </div>
                                          <div class="form-group">
													 <label class="col-md-2 control-label">Nội dung câu hỏi:</label> 
													 <div class="col-md-10"><textarea rows="3" cols="5" id="soanthao" name="content" class="form-control"><?php if(!empty($data)){echo $data->content;};?></textarea></div>
										  </div>
                                          <div class="form-group">
                                                <div class="col-md-10"><h2>Phần Đáp án</h2></div>
										  </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Đáp Án A:</label> 
											 <div class="col-md-10"><input name="a" id="a" type="text" value="<?php if(!empty($data)){echo $data->a;};?>" class="form-control" /></div>
                                          </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Đáp Án B:</label> 
											 <div class="col-md-10"><input name="b" id="b" type="text" value="<?php if(!empty($data)){echo $data->b;};?>" class="form-control" /></div>
                                          </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Đáp Án C:</label> 
											 <div class="col-md-10"><input name="c" id="c" type="text" value="<?php if(!empty($data)){echo $data->c;};?>" class="form-control" /></div>
                                          </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Đáp Án D:</label> 
											 <div class="col-md-10"><input name="d" id="d" type="text" value="<?php if(!empty($data)){echo $data->d;};?>" class="form-control" /></div>
                                          </div>
                                          <div class="form-group">
											 <label class="col-md-2 control-label">Đáp Án đúng:</label> 
                                             <div class="col-md-10">
											 <select name="dung" id="input" class="form-control">
                                                <option <?php if(!empty($data)){if($data->dung=='1')echo 'selected="selected"';} ?> value='1'>A</option> 
                                                <option <?php if(!empty($data)){if($data->dung=='2')echo 'selected="selected"';} ?> value='2'>B</option> 
                                                <option <?php if(!empty($data)){if($data->dung=='3')echo 'selected="selected"';} ?> value='3'>C</option> 
                                                <option <?php if(!empty($data)){if($data->dung=='4')echo 'selected="selected"';} ?> value='4'>D</option> 
                                            </select>
                                            </div>
                                          </div>
                                          <input class="guidulieu btn btn-success" type="submit" value="Lưu"/>
										</form>
                                        <!-- End Form -->
                                    </div>
								</div>
								<!-- /BOX -->
							</div>
						</div>
						<!-- /DATA TABLES -->
    			<!-- /PAGE HEADER -->
    		</div>
    	</div>
    </div>
</div>